package main;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.JTextArea;

/**
 * 
 * @author David Doyle
 *
 */
public class LawBar extends JTextArea {


	String currentText = "";

	/**
	 * This method initializes 
	 * @param width
	 * @param height
	 * 
	 * @author David Doyle
	 */
	public LawBar(int width, int height) {
		super();
		initialize(width,height);

		// Listener for the Text Area
		MouseListener ml =  new MouseListener(){
			@Override
			public void mouseClicked(MouseEvent arg0) {
			}

			@Override
			public void mouseEntered(MouseEvent arg0) {
			}

			@Override
			public void mouseExited(MouseEvent arg0) {
			}

			@Override
			public void mousePressed(MouseEvent arg0) {
			}

			@Override
			public void mouseReleased(MouseEvent arg0) {
			}
		};
		addMouseListener(ml);
	}

	/**
	 * This method initializes this
	 * 
	 * @author David Doyle
	 */
	private void initialize(int width, int height) {
		this.setSize(width, height);

		setText("0	Associative	[(X \u2261 (Y \u2261 Z)) \u2261 ((X \u2261 Y) \u2261 Z)]\n" +
				"1	Symmetric	[X \u2261 Y \u2261 Y \u2261 X]\n" +
				"2	Identity	[X \u2261 true \u2261 X]\n" +
				"3	Reflexive	[X \u2261 X}\n" +
				"4	True	true\n" +

				"5	\u22C1 symmetric	[X \u22C1 Y \u2261 Y \u22C1 X]\n" +
				"6	\u22C1 associative	[X \u22C1 (Y \u22C1 Z) \u2261 (X \u22C1 Y) \u22C1 Z]\n" +
				"7	\u22C1 idempotent	[X \u22C1 X \u2261 X]\n" +
				"8	\u22C1/\u2261	[X \u22C1 (Y \u2261 Z) \u2261 X \u22C1 Y \u2261 X \u2261 Z]\n" +
				"9	\u22C1/\u22C1	[X \u22C1 (y \u22C1 Z) \u2261 (X \u22C1 Y) \u22C1 (X \u22C1 Z)]\n" +
				"10	\u22C1	[X \u22C1 true \u2261 true]\n" +

				"11	Golden Rule	[X \u22C0 Y \u2261 X \u2261 Y \u2261 X \u22C1 Y]\n" +
				"12	\u22C0 symmetric	[X \u22C0 Y \u2261 Y \u22C0 X]\n" +
				"13	\u22C0 associative	[X \u22C0 (Y \u22C0 Z) \u2261 (X \u22C1 Y) \u22C1 Z]\n" +
				"14	\u22C0 idempotent	[X \u22C0 X \u2261 X)\n" +
				"15	\u22C0 identity	[X \u22C0 true \u2261 X]\n" +
				"16	abs\u22C1ption.0	[X \u22C0 (X \u22C1 Y) \u2261 X]\n" +
				"17	abs\u22C1ption.1	[X \u22C1 (X \u22C0 Y) \u2261 X]\n" +
				"18	\u22C1/\u22C0 	[X \u22C1 (Y \u22C0 Z) \u2261 (X \u22C1 Y] \u22C0 (X \u22C1 Z)]\n" +
				"19	\u22C0/\u22C1	[X \u22C0 (Y \u22C1 Z) \u2261 (X \u22C0 Y) \u22C1 (X \u22C0 Z)]\n" +
				"20	\u22C0 over \u2261	[X \u22C0 (Y \u2261 Z) \u2261 X \u22C0 Y \u2261 X \u22C0 Z \u2261 X]\n" +
				"21	\u22C0/\u2261\u2261	[X \u22C0 (Y \u2261 Z \u2261 W) \u2261 X \u22C0 Y \u2261 X \u22C0 Z \u2261 X \u22C0 W]\n" +
				"22	strong MP	[X \u22C0 (X \u2261 Y) \u2261 X \u22C0 Y]\n" +
				"23	replacement	[(X \u2261 Y) \u22C0 (W \u2261 X) \u2261 (X \u2261 Y) \u22C0 (W \u2261 Y)]\n" +

				"24	\u21D2 definition	[X \u21D2 Y \u2261 X \u22C0 Y \u2261 Y]\n" +
				"25	\u21D2 reflexive	[X \u21D2 X]\n" +
				"26	\u21D2 true	[X \u21D2 true]\n" +
				"27	\u21D2 \u22C1	[X \u21D2 X \u22C1 Y]\n" +
				"28	\u22C0 \u21D2	[X \u22C0 Y \u21D2 X]\n" +
				"29	shunting	[X \u22C0 Y \u21D2 Z \u2261 X \u21D2 (Y \u21D2 Z)]\n" +
				"30	\u21D2 to \u22C0 \u2261	[X \u21D2 Y \u2261 X \u22C0 Y \u2261 X]\n" +
				"31	\u21D2 over \u2261	[X \u21D2 (Y \u2261 Z) \u2261 X \u22C0 Y \u2261 X \u22C0 Z]\n" +
				"31a	\u21D2 distributes	[X \u21D2 (Y \u2261 Z) \u2261 X \u21D2 Y \u2261 X \u21D2 Z]\n" +
				"33	\u22D0 definition	[X \u22D0 Y \u2261 X \u22C0 Y \u2261 Y]\n" +
				"34	\u22D0\u21D2	[X \u22D0 Y \u2261 Y \u21D2 X]\n" +

				"35	false definition	[false \u2261 \u00ACtrue]\n" +
				"36	\u00AC over \u2261	[\u00AC(X \u2261 Y) \u2261 \u00ACX \u2261 Y]\n" +
				"37	\u00AC flip	[\u00ACX \u2261 Y \u2261 X \u2261 \u00ACY]\n" +
				"38	\u00AC\u00AC	[\u00AC\u00ACX \u2261 Y]\n" +
				"39	excluded middle	[X \u22C1 \u00ACX]\n" +
				"40	\u00AC \u22C1 \u2261	[\u00ACX \u22C1 Y \u2261 X \u22C1 Y \u2261 Y]\n" +
				"41	\u22C1 identity	[X \u22C1 false \u2261 X]\n" +
				"42	\u22C0 zero	[X \u22C0 false \u2261 false]\n" +
				"43	deM\u22C1gan.0	[\u00ACX \u22C1 \u00ACY \u2261 \u00AC(X \u22C0 Y)]\n" +
				"44	\u00AC \u22C0 \u2261	[\u00ACX \u22C0 Y \u2261 X \u22C0 Y \u2261 \u00ACY]\n" +
				"45	deM\u22C1gan.1	[\u00ACX \u22C0 \u00ACY \u2261 \u00AC(X \u22C1 Y)]\n" +
				"46	complement.0	[X \u22C1 (\u00ACX \u22C0 Y) \u2261 X \u22C1 Y]\n" +
				"47	complement.1	[X \u22C0 (\u00ACX \u22C1 Y) \u2261 X \u22C0 Y]\n" +
				"48	\u2261 to \u22C0 \u22C1	[X \u2261 Y \u2261 (X \u22C0 Y) \u22C1 (\u00ACX \u22C0 \u00ACT)]\n" +
				"49	contradiction	[X \u22C0 \u00ACX \u2261 false]\n" +
				"50	\u21C1 to \u00AC \u22C1	[X \u21C1 Y \u2261 \u00ACX \u22C1 Y]\n" +
				"51	contra-positive	[X \u21C1 Y \u2261 \u00ACY \u21C1 \u00ACX]\n" +
				"52	false \u21C1	[false \u21C1 X]\n" +
				"53	reducto ad absurdum	[X \u21C1 false \u2261 \u00ACX]\n" +
				"54	\u00AC false 	[\u00ACfalse \u2261 true]\n" +
				"55	MP	[X \u22C0(X \u21C1 Y) \u21C1 Y]\n"
		);



	}

	/**
	 * Updates the currentText variable with the contents of the text area
	 * (possible solution for file I/O and recovery)
	 * 
	 * @author Balazs Pete
	 */
	public void updateText(){
		currentText = this.getText();
		//Remove // to see result in console..
		//System.out.println(currentText);
	}

	
}  //  @jve:decl-index=0:visual-constraint="99,17"
